// Copyright (C) INFINI Labs & INFINI LIMITED.
//
// The INFINI Console is offered under the GNU Affero General Public License v3.0
// and as commercial software.
//
// For commercial licensing, contact us at:
//   - Website: infinilabs.com
//   - Email: hello@infini.ltd
//
// Open Source licensed under AGPL V3:
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

const getMockLineData = (type) => {
  return [
    [1613898840000, Math.floor(Math.random() * 10000)],
    [1613898870000, Math.floor(Math.random() * 10000)],
    [1613898900000, Math.floor(Math.random() * 10000)],
    [1613898930000, Math.floor(Math.random() * 10000)],
    [1613898960000, Math.floor(Math.random() * 10000)],
    [1613898990000, Math.floor(Math.random() * 10000)],
    [1613899020000, Math.floor(Math.random() * 10000)],
    [1613899050000, Math.floor(Math.random() * 10000)],
    [1613899080000, Math.floor(Math.random() * 10000)],
    [1613899110000, Math.floor(Math.random() * 10000)],
    [1613899140000, Math.floor(Math.random() * 10000)],
    [1613899170000, Math.floor(Math.random() * 10000)],
    [1613899200000, Math.floor(Math.random() * 10000)],
    [1613899230000, Math.floor(Math.random() * 10000)],
  ];
};

export default {
  "GET /_search-center/elasticsearch/overview": function(req, res) {
    res.send({
      total_used_store_in_bytes: 440421143206,
      hosts_count: 16,
      nodes_count: 64,
      clusters_count: 2,
      indices_count: 901,
    });
  },

  "GET /elasticsearch/cluster/_search": function(req, res) {
    res.send({
      took: 0,
      timed_out: false,
      hits: {
        total: {
          value: 1,
          relation: "eq",
        },
        max_score: 1.0,
        hits: [
          {
            _index: "infini",
            _type: "_doc",
            _id: "12121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                id: "-XRnYWyxSiC_7bvrCLEb-A",
                name: "test-cluster",
                version: "7.10.0",
                description: "集群备注",

                project: {
                  id: "12312312",
                  name: "统一日志云平台v1.0",
                },
                location: {
                  provider: "阿里云",
                  region: "北京",
                  dc: "昌平机房",
                  rack: "rack-1",
                },
                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
              },

              summary: {
                //data exists
                status: "green",
                timed_out: false,
                number_of_nodes: 1,
                number_of_data_nodes: 1,
                active_primary_shards: 16,
                active_shards: 16,
                relocating_shards: 0,
                initializing_shards: 0,
                unassigned_shards: 16,
                delayed_unassigned_shards: 0,
                number_of_pending_tasks: 0,
                number_of_in_flight_fetch: 0,
                task_max_waiting_in_queue_millis: 0,
                active_shards_percent_as_number: 50,

                //data not ready
                number_of_indices: 2400,
                number_of_documents: 143430000,
                fs: {
                  available_in_bytes: 23100146163712,
                  free_in_bytes: 23100146163712,
                  total_in_bytes: 24002405851136,
                },
                jvm: {
                  heap_max_in_bytes: 25298731008,
                  heap_used_in_bytes: 2229809408,
                },
              },

              metrics: {
                status: {
                  metric: {
                    label: "Recent Cluster Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "red"],
                    [1613898870000, "red"],
                    [1613898900000, ""],
                    [1613898840000, "yellow"],
                    [1613898840000, "yellow"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                  ],
                },
                search: {
                  metric: {
                    label: "Search",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                indexing: {
                  metric: {
                    label: "Indexing",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
          {
            _index: "infini",
            _type: "_doc",
            _id: "22121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                id: "-XRnYWyxSiC_7bvrCLEb-A",
                name: "test-cluster",
                version: "7.10.0",

                project: {
                  id: "12312312",
                  name: "统一日志云平台v1.0",
                },
                location: {
                  provider: "阿里云",
                  region: "北京",
                  dc: "昌平机房",
                  rack: "rack-1",
                },
                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
              },

              summary: {
                //data exists
                status: "yellow",
                timed_out: false,
                number_of_nodes: 1,
                number_of_data_nodes: 1,
                active_primary_shards: 16,
                active_shards: 16,
                relocating_shards: 0,
                initializing_shards: 0,
                unassigned_shards: 16,
                delayed_unassigned_shards: 0,
                number_of_pending_tasks: 0,
                number_of_in_flight_fetch: 0,
                task_max_waiting_in_queue_millis: 0,
                active_shards_percent_as_number: 50,

                //data not ready
                number_of_indices: 2400,
                number_of_documents: 143430000,
                fs: {
                  available_in_bytes: 23100146163712,
                  free_in_bytes: 23100146163712,
                  total_in_bytes: 24002405851136,
                },
                jvm: {
                  heap_max_in_bytes: 25298731008,
                  heap_used_in_bytes: 2229809408,
                },
              },

              metrics: {
                status: {
                  metric: {
                    label: "Recent Cluster Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "red"],
                    [1613898870000, "red"],
                    [1613898900000, ""],
                    [1613898840000, "yellow"],
                    [1613898840000, "yellow"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                  ],
                },
                search: {
                  metric: {
                    label: "Search",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                indexing: {
                  metric: {
                    label: "Indexing",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
        ],
      },
    });
  },
  "GET /elasticsearch/:id/nodes": function(req, res) {
    res.send([
      {
        cpu: 35,
        "disk.avail": "15.2G",
        "heap.percent": 61,
        id: "tFPCPsfLQqG_mo13W1dlYw",
        ip: "127.0.0.1",
        load_1m: 37.2998046875,
        name: "node-1",
        port: null,
        shards: 75,
        status: "available",
        timestamp: "2022-04-02T15:45:32.917325+08:00",
      },
      {
        cpu: 3,
        "disk.avail": "20.8T",
        "heap.percent": 38,
        id: "xLDzQ9fWSL214eP-8_UoRA",
        ip: "192.168.3.188",
        load_1m: null,
        name: "node-714-2",
        port: "9426",
        shards: 27,
        status: "available",
        timestamp: "2022-04-02T15:49:53.192199+08:00",
      },
      {
        cpu: 3,
        "disk.avail": "20.8T",
        "heap.percent": 64,
        id: "UZZvqAS6TWujQT4cN6rjzw",
        ip: "192.168.3.188",
        load_1m: null,
        name: "LENOVO",
        port: "9406",
        shards: 27,
        status: "available",
        timestamp: "2022-04-02T15:49:53.164366+08:00",
      },
    ]);
  },
  "GET /elasticsearch/:id/nodes/realtime": function(req, res) {
    res.send([
      {
        id: "tFPCPsfLQqG_mo13W1dlYw",
        ip: "127.0.0.1",
        port: "9300",
        "heap.percent": "64",
        "ram.percent": "",
        cpu: "16",
        load_1m: "2.55",
        load_5m: null,
        load_15m: null,
        "node.role": "",
        master: "*",
        name: "node-1",
        "disk.avail": "23.2gb",
        shards: 73,
        uptime: "3.1d",
      },
      {
        id: "tFPCPsfLQqG_mo13W1dlY2",
        ip: "127.0.0.1",
        port: "9302",
        "heap.percent": "34",
        "ram.percent": "",
        cpu: "46",
        load_1m: "1.55",
        load_5m: null,
        load_15m: null,
        "node.role": "",
        master: "*",
        name: "node-2",
        "disk.avail": "33.2gb",
        shards: 73,
        uptime: "4.1m",
        status: "unavailable",
      },
    ]);
  },

  "GET /elasticsearch/:id/indices": function(req, res) {
    res.send([
      {
        docs_count: 8,
        health: "green",
        id: "54dukC0qRsm1CjcV24Yj8A",
        index: ".monitoring-kibana-7-2022.04.02",
        pri_store_size: "128.2kb",
        segments_count: 4,
        shards: 1,
        status: "open",
        store_size: "128.2kb",
        timestamp: "2022-04-02T11:44:29.499326+08:00",
      },
      {
        docs_count: 62145,
        docs_deleted: 98670,
        health: "green",
        id: "KfD9u6nrSVegdHq3swx1-w",
        index: ".monitoring-es-7-2022.04.02",
        pri_store_size: "31.2mb",
        segments_count: 8,
        shards: 1,
        status: "open",
        store_size: "31.2mb",
        timestamp: "2022-04-02T11:44:29.497207+08:00",
      },
      {
        docs_count: 2,
        health: "yellow",
        id: "ZPdZ2nsVTr-sTNloEv-VUQ",
        index: ".infini_gateway-instance",
        pri_store_size: "30.5kb",
        replicas: 1,
        segments_count: 2,
        shards: 1,
        status: "open",
        store_size: "30.5kb",
        timestamp: "2022-04-02T11:44:29.482517+08:00",
      },
    ]);
  },
  "GET /elasticsearch/:id/indices/realtime": function(req, res) {
    res.send([
      {
        id: "c8i1ce5ath2blrusdlog",
        index: "test",
        status: "open",
        health: "green",
        shards: 1,
        replicas: 1,
        docs_count: 76000,
        docs_deleted: 21,
        segments_count: 8,
        store_size: "102.3kb",
        pri_store_size: "102.3kb",
      },
      {
        id: "90kSevfnTcOLzNRuhpKMU1",
        index: "my-blog",
        status: "open",
        health: "yellow",
        shards: 1,
        replicas: 1,
        docs_count: 176000,
        docs_deleted: 42,
        segments_count: 8,
        store_size: "10102.3kb",
        pri_store_size: "10102.3kb",
      },
      {
        id: "QTE2OAKFT1GbZRqbyKLXlw",
        index: ".infini_view",
        status: "open",
        health: "yellow",
        shards: 1,
        replicas: 1,
        docs_count: 176000,
        store_size: "208b",
        pri_store_size: "208b",
      },
      {
        id: "LvHlbsZfTiiSCnwTmnPjCw",
        index: ".infini_metadata-host",
        status: "open",
        health: "yellow",
        shards: 1,
        replicas: 1,
        docs_count: 1,
        segments_count: 1,
        store_size: "5.7kb",
        pri_store_size: "5.7kb",
      },
      {
        id: "90kSevfnTcOLzNRuhpKMUA",
        index: ".infini_index",
        status: "open",
        health: "yellow",
        shards: 1,
        replicas: 1,
        docs_count: 176,
        docs_deleted: 42,
        segments_count: 8,
        store_size: "1012.3kb",
        pri_store_size: "1012.3kb",
      },
    ]);
  },

  "GET /elasticsearch/host/_search": function(req, res) {
    res.send({
      took: 0,
      timed_out: false,
      hits: {
        total: {
          value: 1,
          relation: "eq",
        },
        max_score: 1.0,
        hits: [
          {
            _index: "infini",
            _type: "_doc",
            _id: "12121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                name: "test-host",
                location: {
                  provider: "阿里云",
                  region: "北京",
                  dc: "昌平机房",
                  rack: "rack-1",
                },
                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
                network: [
                  {
                    internal_ip: "172.18.48.1",
                    external_ip: "201.18.3.188",
                    mac_address: "dc:a9:04:7e:31:91",
                    net_card: "eh0",
                  },
                ],
                os: {
                  name: "Windows 10",
                  arch: "amd64",
                  version: "10.0",
                  available_processors: 24,
                },
              },
              summary: {
                status: "green",
                uptime: 2336700,
                used_store_bytes: 24404211,
                max_store_bytes: 44404211,
                used_memory_bytes: 24404211,
                max_memory_bytes: 164404211,
              },
              metrics: {
                status: {
                  metric: {
                    label: "Recent Host Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "red"],
                    [1613898870000, "red"],
                    [1613898900000, ""],
                    [1613898840000, "yellow"],
                    [1613898840000, "yellow"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                  ],
                },
                cpu: {
                  metric: {
                    label: "CPU",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                io: {
                  metric: {
                    label: "IO",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                network: {
                  metric: {
                    label: "Network",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
          {
            _index: "infini",
            _type: "_doc",
            _id: "22121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                name: "test-host2",
                location: {
                  provider: "阿里云",
                  region: "北京",
                  dc: "昌平机房",
                  rack: "rack-1",
                },
                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
                network: [
                  {
                    internal_ip: "172.18.48.1",
                    external_ip: "201.18.3.188",
                    mac_address: "dc:a9:04:7e:31:91",
                    net_card: "eh0",
                  },
                ],
                os: {
                  name: "Windows 10",
                  arch: "amd64",
                  version: "10.0",
                  available_processors: 24,
                },
              },
              summary: {
                status: "",
                uptime: 2336700,
                used_store_bytes: 24404211,
                max_store_bytes: 44404211,
                used_memory_bytes: 24404211,
                max_memory_bytes: 164404211,
              },
              metrics: {
                status: {
                  metric: {
                    label: "Recent Host Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "red"],
                    [1613898870000, "red"],
                    [1613898900000, ""],
                    [1613898840000, "yellow"],
                    [1613898840000, "yellow"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                  ],
                },
                cpu: {
                  metric: {
                    label: "CPU",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                io: {
                  metric: {
                    label: "IO",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                network: {
                  metric: {
                    label: "Network",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
        ],
      },
    });
  },
  "GET /elasticsearch/host/:id/info": function(req, res) {
    res.send({
      name: "host1",
      cluster_name: "cluster1",
      status: "green",
      timed_out: false,
      number_of_nodes: 1000,
      number_of_data_nodes: 1000,
      active_primary_shards: 50000006,
      active_shards: 50000006,
      relocating_shards: 0,
      initializing_shards: 0,
    });
  },

  "GET /elasticsearch/node/_search": function(req, res) {
    res.send({
      took: 0,
      timed_out: false,
      hits: {
        total: {
          value: 1,
          relation: "eq",
        },
        max_score: 1.0,
        hits: [
          {
            _index: "infini",
            _type: "_doc",
            _id: "12121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                node_id: "tFPCPsfLQqG_mo13W1dlYw",
                name: "test-node1",
                cluster_id: "tFPCPsfLQqG_mo13W1dlYx",
                cluster_name: "cluster1",
                ip: "127.0.0.1",
                version: "7.10.0",
                java_version: "1.8",
                roles: [
                  "data",
                  "data_cold",
                  "data_content",
                  "data_hot",
                  "data_warm",
                  "ingest",
                  "master",
                  "ml",
                  "remote_cluster_client",
                  "transform",
                ],
                os: {
                  allocated_processors: 4,
                  arch: "x86_64",
                  available_processors: 4,
                  name: "Mac OS X",
                  pretty_name: "Mac OS X",
                  refresh_interval_in_millis: 1000,
                  version: "11.1",
                },

                location: {
                  provider: "阿里云",
                  region: "北京",
                  dc: "昌平机房",
                  rack: "rack-1",
                },
                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
              },
              summary: {
                status: "online",
                uptime: 2336700,
                fs: {
                  total: {
                    available_in_bytes: 23100146163712,
                    free_in_bytes: 23100146163712,
                    total_in_bytes: 24002405851136,
                  },
                },
                jvm: {
                  mem: {
                    heap_max_in_bytes: 25298731008,
                    heap_used_in_bytes: 2229809408,
                  },
                },
              },
              metrics: {
                status: {
                  metric: {
                    label: "Recent Node Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "online"],
                    [1613898870000, "online"],
                    [1613898900000, ""],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "online"],
                    [1613898840000, "online"],
                  ],
                },
                cpu: {
                  metric: {
                    label: "CPU",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                indexing: {
                  metric: {
                    label: "Indexing",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                search: {
                  metric: {
                    label: "Search",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
          {
            _index: "infini",
            _type: "_doc",
            _id: "22121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                node_id: "tFPCPsfLQqG_mo13W1dlYw",
                name: "test-node1",
                cluster_id: "tFPCPsfLQqG_mo13W1dlYx",
                cluster_name: "cluster1",
                ip: "127.0.0.1",
                version: "7.10.0",
                java_version: "1.8",
                roles: [
                  "data",
                  "data_cold",
                  "data_content",
                  "data_hot",
                  "data_warm",
                  "ingest",
                  "master",
                  "ml",
                  "remote_cluster_client",
                  "transform",
                ],
                os: {
                  allocated_processors: 4,
                  arch: "x86_64",
                  available_processors: 4,
                  name: "Mac OS X",
                  pretty_name: "Mac OS X",
                  refresh_interval_in_millis: 1000,
                  version: "11.1",
                },

                location: {
                  provider: "阿里云",
                  region: "北京",
                  dc: "昌平机房",
                  rack: "rack-1",
                },
                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
              },
              summary: {
                status: "offline",
                uptime: 2336700,
                fs: {
                  total: {
                    available_in_bytes: 23100146163712,
                    free_in_bytes: 23100146163712,
                    total_in_bytes: 24002405851136,
                  },
                },
                jvm: {
                  mem: {
                    heap_max_in_bytes: 25298731008,
                    heap_used_in_bytes: 2229809408,
                  },
                },
              },
              metrics: {
                status: {
                  metric: {
                    label: "Recent Node Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "online"],
                    [1613898870000, "online"],
                    [1613898900000, ""],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "online"],
                    [1613898840000, "online"],
                    [1613898840000, "offline"],
                  ],
                },
                cpu: {
                  metric: {
                    label: "CPU",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                indexing: {
                  metric: {
                    label: "Indexing",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                search: {
                  metric: {
                    label: "Search",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
          {
            _index: "infini",
            _type: "_doc",
            _id: "32121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                node_id: "tFPCPsfLQqG_mo13W1dlYw",
                name: "test-node1",
                cluster_id: "tFPCPsfLQqG_mo13W1dlYx",
                cluster_name: "cluster1",
                ip: "127.0.0.1",
                version: "7.10.0",
                java_version: "1.8",
                roles: [
                  "data",
                  "data_cold",
                  "data_content",
                  "data_hot",
                  "data_warm",
                  "ingest",
                  "master",
                  "ml",
                  "remote_cluster_client",
                  "transform",
                ],
                os: {
                  allocated_processors: 4,
                  arch: "x86_64",
                  available_processors: 4,
                  name: "Mac OS X",
                  pretty_name: "Mac OS X",
                  refresh_interval_in_millis: 1000,
                  version: "11.1",
                },

                location: {
                  provider: "阿里云",
                  region: "北京",
                  dc: "昌平机房",
                  rack: "rack-1",
                },
                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
              },
              summary: {
                status: "online",
                uptime: 2336700,
                fs: {
                  total: {
                    available_in_bytes: 23100146163712,
                    free_in_bytes: 23100146163712,
                    total_in_bytes: 24002405851136,
                  },
                },
                jvm: {
                  mem: {
                    heap_max_in_bytes: 25298731008,
                    heap_used_in_bytes: 2229809408,
                  },
                },
              },
              metrics: {
                status: {
                  metric: {
                    label: "Recent Node Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "online"],
                    [1613898870000, "online"],
                    [1613898900000, ""],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "offline"],
                    [1613898840000, "online"],
                    [1613898840000, "online"],
                  ],
                },
                cpu: {
                  metric: {
                    label: "CPU",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                indexing: {
                  metric: {
                    label: "Indexing",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                search: {
                  metric: {
                    label: "Search",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
        ],
      },
    });
  },
  "GET /elasticsearch/:cluster_id/node/:node_id/info": function(req, res) {
    res.send({
      is_master_node: true,
      fs: {
        total: {
          available_in_bytes: 23581824712704,
          free_in_bytes: 23581824712704,
          total_in_bytes: 24002405851136,
        },
      },
      indices: {
        docs: {
          count: 9935568,
          deleted: 1,
        },
        store: {
          size_in_bytes: 2254393295,
        },
      },
      indices_count: 14,
      jvm: {
        mem: {
          heap_committed_in_bytes: 10580393984,
          heap_max_in_bytes: 10580393984,
          heap_used_in_bytes: 1763589328,
          heap_used_percent: 16,
        },
      },
      roles: ["master", "data", "ingest"],
      shards_count: 28,
      status: "offline",
      transport_address: "172.23.48.1:9300",
    });
  },
  "GET /elasticsearch/:cluster_id/node/:node_id/metrics": function(req, res) {
    res.send({
      metrics: {
        index_latency: {
          key: "index_latency",
          axis: [
            {
              id: "c890q40vi0759loa75d0",
              group: "group1",
              title: "indexing",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: true,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 0],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 0],
                [1645349370000, 0],
                [1645349380000, 4],
                [1645349390000, 0.04766666666666667],
                [1645349400000, 0.1188118811881188],
                [1645349410000, 0.07380211574362165],
                [1645349420000, 0.06666666666666667],
                [1645349430000, 0.281651376146789],
                [1645349440000, 0],
                [1645349450000, 0.10551997560231778],
                [1645349460000, 0.0611448395490026],
                [1645349470000, 0.08357142857142857],
                [1645349480000, 0],
                [1645349490000, 0.156],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 0],
                [1645349530000, 0],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Indexing",
                label: "Indexing Latency",
                description: "Average latency for indexing documents.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.primaries.indexing.index_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 0],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 0],
                [1645349370000, 0],
                [1645349380000, 0],
                [1645349390000, 0],
                [1645349400000, 0],
                [1645349410000, 0],
                [1645349420000, 0],
                [1645349430000, 0],
                [1645349440000, 0],
                [1645349450000, 0],
                [1645349460000, 0],
                [1645349470000, 0],
                [1645349480000, 0],
                [1645349490000, 0],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 0],
                [1645349530000, 0],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Indexing",
                label: "Delete Latency",
                description: "Average latency for delete documents.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.primaries.indexing.delete_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "latency",
          order: 3,
        },
        index_throughput: {
          key: "index_throughput",
          axis: [
            {
              id: "c890q40vi0759loa75ag",
              group: "group1",
              title: "indexing",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: true,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 0],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 0],
                [1645349370000, 0],
                [1645349380000, 0.2],
                [1645349400000, 20.2],
                [1645349410000, 1607],
                [1645349420000, 51],
                [1645349430000, 218],
                [1645349440000, 0],
                [1645349450000, 1967.4],
                [1645349460000, 1383.6],
                [1645349470000, 560],
                [1645349480000, 0],
                [1645349490000, 200],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 0],
                [1645349530000, 0],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Indexing Rate",
                label: "Total Shards",
                description:
                  "Number of documents being indexed for primary and replica shards.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.indexing.index_total",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "doc/s",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 0],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 0],
                [1645349370000, 0],
                [1645349380000, 0.1],
                [1645349400000, 10.1],
                [1645349410000, 803.5],
                [1645349420000, 25.5],
                [1645349430000, 109],
                [1645349440000, 0],
                [1645349450000, 983.7],
                [1645349460000, 691.8],
                [1645349470000, 280],
                [1645349480000, 0],
                [1645349490000, 100],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 0],
                [1645349530000, 0],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Indexing Rate",
                label: "Primary Shards",
                description:
                  "Number of documents being indexed for primary shards.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.primaries.indexing.index_total",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "doc/s",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "operations",
          order: 2,
        },
        search_latency: {
          key: "search_latency",
          axis: [
            {
              id: "c890q40vi0759loa75eg",
              group: "group2",
              title: "searching",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: false,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 0],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 0],
                [1645349370000, 0],
                [1645349380000, 0],
                [1645349390000, 3.6794871794871793],
                [1645349400000, 0],
                [1645349410000, 0],
                [1645349420000, 0.17857142857142858],
                [1645349430000, 0.375],
                [1645349440000, 0],
                [1645349450000, 0.16666666666666666],
                [1645349460000, 0],
                [1645349470000, 0],
                [1645349480000, 0],
                [1645349490000, 0],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 1],
                [1645349530000, 1],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group2",
                title: "Searching",
                label: "Query Latency",
                description: "Average latency for searching query.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.query_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 0],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 0],
                [1645349370000, 0],
                [1645349380000, 0],
                [1645349390000, 8.41025641025641],
                [1645349400000, 0],
                [1645349410000, 0],
                [1645349420000, 0],
                [1645349430000, 0.125],
                [1645349440000, 0],
                [1645349450000, 0],
                [1645349460000, 0],
                [1645349470000, 0],
                [1645349480000, 0],
                [1645349490000, 0],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 0],
                [1645349530000, 0],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group2",
                title: "Searching",
                label: "Fetch Latency",
                description: "Average latency for searching fetch.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.fetch_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 623002],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 614544.75],
                [1645349370000, 0],
                [1645349380000, 635314.5],
                [1645349390000, 617531.75],
                [1645349400000, 0],
                [1645349410000, 0],
                [1645349420000, 0],
                [1645349430000, 0],
                [1645349440000, 0],
                [1645349450000, 0],
                [1645349460000, 0],
                [1645349470000, 0],
                [1645349480000, 0],
                [1645349490000, 0],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 0],
                [1645349530000, 0],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group2",
                title: "Searching",
                label: "Scroll Latency",
                description: "Average latency for searching fetch.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.scroll_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "latency",
          order: 3,
        },
        search_throughput: {
          key: "search_throughput",
          axis: [
            {
              id: "c890q40vi0759loa75c0",
              group: "group1",
              title: "searching",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: false,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1645349260000,
                max: 1645350140000,
              },
              data: [
                [1645349270000, 0],
                [1645349280000, 0],
                [1645349290000, 0],
                [1645349300000, 0],
                [1645349310000, 0],
                [1645349320000, 0],
                [1645349330000, 0],
                [1645349340000, 0],
                [1645349350000, 0],
                [1645349360000, 0],
                [1645349370000, 0],
                [1645349380000, 0],
                [1645349400000, 0],
                [1645349410000, 0],
                [1645349420000, 2.8],
                [1645349430000, 0.8],
                [1645349440000, 0],
                [1645349450000, 0.6],
                [1645349460000, 0],
                [1645349470000, 0],
                [1645349480000, 0],
                [1645349490000, 0],
                [1645349500000, 0],
                [1645349510000, 0],
                [1645349520000, 0.1],
                [1645349530000, 0.2],
                [1645349540000, 0],
                [1645349550000, 0],
                [1645349560000, 0],
                [1645349570000, 0],
                [1645349580000, 0],
                [1645349590000, 0],
                [1645349600000, 0],
                [1645349610000, 0],
                [1645349620000, 0],
                [1645349630000, 0],
                [1645349640000, 0],
                [1645349650000, 0],
                [1645349660000, 0],
                [1645349670000, 0],
                [1645349680000, 0],
                [1645349690000, 0],
                [1645349700000, 0],
                [1645349710000, 0],
                [1645349720000, 0],
                [1645349730000, 0],
                [1645349740000, 0],
                [1645349750000, 0],
                [1645349760000, 0],
                [1645349770000, 0],
                [1645349780000, 0],
                [1645349790000, 0],
                [1645349800000, 0],
                [1645349810000, 0],
                [1645349820000, 0],
                [1645349830000, 0],
                [1645349840000, 0],
                [1645349850000, 0],
                [1645349860000, 0],
                [1645349870000, 0],
                [1645349880000, 0],
                [1645349890000, 0],
                [1645349900000, 0],
                [1645349910000, 0],
                [1645349920000, 0],
                [1645349930000, 0],
                [1645349940000, 0],
                [1645349950000, 0],
                [1645349960000, 0],
                [1645349970000, 0],
                [1645349980000, 0],
                [1645349990000, 0],
                [1645350000000, 0],
                [1645350010000, 0],
                [1645350020000, 0],
                [1645350030000, 0],
                [1645350040000, 0],
                [1645350050000, 0],
                [1645350060000, 0],
                [1645350070000, 0],
                [1645350080000, 0],
                [1645350090000, 0],
                [1645350100000, 0],
                [1645350110000, 0],
                [1645350120000, 0],
                [1645350130000, 0],
                [1645350140000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Search Rate",
                label: "Total Shards",
                description:
                  "Number of search requests being executed across primary and replica shards. A single search can run against multiple shards!",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.query_total",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "query/s",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "operations",
          order: 2,
        },
      },
    });
  },

  "GET /elasticsearch/index/_search": function(req, res) {
    res.send({
      took: 0,
      timed_out: false,
      hits: {
        total: {
          value: 1,
          relation: "eq",
        },
        max_score: 1.0,
        hits: [
          {
            _index: "infini",
            _type: "_doc",
            _id: "12121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                id: "c89igl1pdamkspckfceg",
                cluster_id: "c89igl1pdamkspckfce2",
                index_id: "WX5uTaFkSaelnaDLwF7I8g",
                index_name: ".apm-custom-link",
                aliases: ["test-index2-alias"],
                timestamp: "2022-02-21T13:51:14.987166+08:00",
                remark: "remark something",
                tags: ["tag1", "tag2", "tag3"],

                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
              },

              summary: {
                docs: {
                  count: 1,
                  deleted: 0,
                },
                index_info: {
                  docs_count: 1,
                  health: "yellow",
                  id: "gTJdxB_NRAOCDmxx0BCz1g",
                  index: ".infini-search-center_setting",
                  pri_store_size: "4.7kb",
                  replicas: 1,
                  segments_count: 1,
                  shards: 1,
                  status: "open",
                  store_size: "4.7kb",
                },
                unassigned_shards: 1,
              },
              metrics: {
                status: {
                  metric: {
                    label: "Recent Indexinging Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "red"],
                    [1613898870000, "red"],
                    [1613898900000, ""],
                    [1613898840000, "yellow"],
                    [1613898840000, "yellow"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                  ],
                },
                slow_query: {
                  metric: {
                    label: "Slow Query",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                indexing: {
                  metric: {
                    label: "Indexing",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                search: {
                  metric: {
                    label: "Search",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
          {
            _index: "infini",
            _type: "_doc",
            _id: "22121",
            _score: 1.0,
            _source: {
              //data exists
              metadata: {
                id: "c89igl1pdamkspckfceg",
                cluster_id: "c89igl1pdamkspckfce1",
                index_id: "WX5uTaFkSaelnaDLwF7I8g",
                index_name: ".apm-custom-link",
                aliases: ["test-index2-alias"],
                timestamp: "2022-02-21T13:51:14.987166+08:00",
                remark: "remark something",
                tags: ["tag1", "tag2", "tag3"],

                owner: [
                  {
                    department: "运维部",
                    name: "廖石阳",
                    id: "123123123",
                  },
                ],
              },

              summary: {
                docs: {
                  count: 1,
                  deleted: 0,
                },
                index_info: {
                  docs_count: 1,
                  health: "yellow",
                  id: "gTJdxB_NRAOCDmxx0BCz1g",
                  index: ".infini-search-center_setting",
                  pri_store_size: "4.7kb",
                  replicas: 1,
                  segments_count: 1,
                  shards: 1,
                  status: "open",
                  store_size: "4.7kb",
                },
                unassigned_shards: 1,
              },
              metrics: {
                status: {
                  metric: {
                    label: "Recent Indexing Status",
                    units: "day",
                  },
                  data: [
                    [1613898840000, "red"],
                    [1613898870000, "red"],
                    [1613898900000, ""],
                    [1613898840000, "yellow"],
                    [1613898840000, "yellow"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                    [1613898840000, "green"],
                  ],
                },
                slow_query: {
                  metric: {
                    label: "Slow Query",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                indexing: {
                  metric: {
                    label: "Indexing",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
                search: {
                  metric: {
                    label: "Search",
                    units: "s",
                  },
                  data: getMockLineData(),
                },
              },
            },
          },
        ],
      },
    });
  },
  "GET /elasticsearch/:cluster_id/index/:index_id/info": function(req, res) {
    res.send({
      aliases: [".kibana"],
      docs: {
        count: 50,
        deleted: 9,
      },
      index_info: {
        docs_count: 50,
        docs_deleted: 9,
        health: "green",
        id: "DVInGa7GS3-qEHgvL0x8zQ",
        index: ".kibana_2",
        pri_store_size: "10.4mb",
        segments_count: 4,
        shards: 1,
        replicas: 1,
        status: "open",
        store_size: "10.4mb",
      },
      unassigned_shards: 0,
    });
  },
  "GET /elasticsearch/:cluster_id/index/:index_name/metrics": function(
    req,
    res
  ) {
    res.send({
      metrics: {
        index_latency: {
          key: "index_latency",
          axis: [
            {
              id: "c90i4a1pdampeupjv3gg",
              group: "group1",
              title: "indexing",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: true,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Indexing",
                label: "Indexing Latency",
                description: "Average latency for indexing documents.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.primaries.indexing.index_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Indexing",
                label: "Delete Latency",
                description: "Average latency for delete documents.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.primaries.indexing.delete_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "latency",
          order: 3,
        },
        index_throughput: {
          key: "index_throughput",
          axis: [
            {
              id: "c90i4a1pdampeupjv3e0",
              group: "group1",
              title: "indexing",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: true,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Indexing Rate",
                label: "Indexing Rate",
                description: "Number of documents being indexed for node.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.primaries.indexing.index_total",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "doc/s",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Deleting Rate",
                label: "Deleting Rate",
                description: "Number of documents being deleted for node.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.primaries.indexing.delete_total",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "doc/s",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "operations",
          order: 1,
        },
        search_latency: {
          key: "search_latency",
          axis: [
            {
              id: "c90i4a1pdampeupjv3i0",
              group: "group2",
              title: "searching",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: false,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group2",
                title: "Searching",
                label: "Query Latency",
                description: "Average latency for searching query.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.query_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group2",
                title: "Searching",
                label: "Fetch Latency",
                description: "Average latency for searching fetch.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.fetch_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group2",
                title: "Searching",
                label: "Scroll Latency",
                description: "Average latency for searching fetch.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.scroll_time_in_millis",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "ms",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "latency",
          order: 4,
        },
        search_throughput: {
          key: "search_throughput",
          axis: [
            {
              id: "c90i4a1pdampeupjv3fg",
              group: "group1",
              title: "searching",
              formatType: "num",
              position: "left",
              tickFormat: "0,0.[00]",
              ticks: 5,
              labelFormat: "0,0",
              showGridLines: false,
            },
          ],
          lines: [
            {
              timeRange: {
                min: 1648434850000,
                max: 1648435740000,
              },
              data: [
                [1648434860000, 0],
                [1648434870000, 0],
                [1648434880000, 0],
                [1648434890000, 0],
                [1648434900000, 0],
                [1648434910000, 0],
                [1648434920000, 0],
                [1648434930000, 0],
                [1648434940000, 0],
                [1648434950000, 0],
                [1648434960000, 0],
                [1648434970000, 0],
                [1648434980000, 0],
                [1648434990000, 0],
                [1648435000000, 0],
                [1648435010000, 0],
                [1648435020000, 0],
                [1648435030000, 0],
                [1648435040000, 0],
                [1648435050000, 0],
                [1648435060000, 0],
                [1648435070000, 0],
                [1648435080000, 0],
                [1648435090000, 0],
                [1648435100000, 0],
                [1648435110000, 0],
                [1648435120000, 0],
                [1648435130000, 0],
                [1648435140000, 0],
                [1648435150000, 0],
                [1648435160000, 0],
                [1648435170000, 0],
                [1648435180000, 0],
                [1648435190000, 0],
                [1648435200000, 0],
                [1648435210000, 0],
                [1648435220000, 0],
                [1648435230000, 0],
                [1648435240000, 0],
                [1648435250000, 0],
                [1648435260000, 0],
                [1648435270000, 0],
                [1648435280000, 0],
                [1648435290000, 0],
                [1648435300000, 0],
                [1648435310000, 0],
                [1648435320000, 0],
                [1648435330000, 0],
                [1648435340000, 0],
                [1648435350000, 0],
                [1648435360000, 0],
                [1648435370000, 0],
                [1648435380000, 0],
                [1648435390000, 0],
                [1648435400000, 0],
                [1648435410000, 0],
                [1648435420000, 0],
                [1648435430000, 0],
                [1648435440000, 0],
                [1648435450000, 0],
                [1648435460000, 0],
                [1648435470000, 0],
                [1648435480000, 0],
                [1648435490000, 0],
                [1648435500000, 0],
                [1648435510000, 0],
                [1648435520000, 0],
                [1648435530000, 0],
                [1648435540000, 0],
                [1648435550000, 0],
                [1648435560000, 0],
                [1648435570000, 0],
                [1648435580000, 0],
                [1648435590000, 0],
                [1648435600000, 0],
                [1648435610000, 0],
                [1648435620000, 0],
                [1648435630000, 0],
                [1648435640000, 0],
                [1648435650000, 0],
                [1648435660000, 0],
                [1648435670000, 0],
                [1648435680000, 0],
                [1648435690000, 0],
                [1648435700000, 0],
                [1648435710000, 0],
                [1648435720000, 0],
                [1648435730000, 0],
                [1648435740000, 0],
              ],
              bucket_size: "10s",
              metric: {
                group: "group1",
                title: "Search Rate",
                label: "Search Rate",
                description: "Number of search requests being executed.",
                metricAgg: "max",
                field:
                  "payload.elasticsearch.index_stats.total.search.query_total",
                formatType: "num",
                format: "0,0.[00]",
                tickFormat: "0,0.[00]",
                units: "query/s",
                hasCalculation: false,
                isDerivative: true,
              },
              color: "",
              type: "",
            },
          ],
          group: "operations",
          order: 2,
        },
      },
    });
  },
};
